﻿using System.Collections.Generic;
using System.Data.SqlClient;

namespace RedRiver.Framework.XtraCommon{
    internal interface IValueSelector{
        /// <summary>
        /// 选中的数据项,如果支持多选则返回第一个选中行;
        /// </summary>
        /// <returns></returns>
        object GetSelected();

        /// <summary>
        /// 设置过滤条件
        /// </summary>
        /// <param name="parameters"></param>
        void SetFilterParameter(params SqlParameter[] parameters);

        /// <summary>
        /// 设置输入原值
        /// </summary>
        /// <param name="val"></param>
        void SetInputValue(string val);
    }

    internal interface IValueSelector<out TModel> : IValueSelector{
        /// <summary>
        /// 选中的数据项,如果支持多选则返回第一个选中行;
        /// </summary>
        /// <returns></returns>
        new TModel GetSelected();

        /// <summary>
        /// 获取多个选中项
        /// </summary>
        /// <returns></returns>
        IEnumerable<TModel> GetSelectedRows();
    }
}